<?php

/**
 * Provinces form base class.
 *
 * @method Provinces getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseProvincesForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IPROVINCE_ID'       => new sfWidgetFormInputHidden(),
      'SNAME_THAI'         => new sfWidgetFormInputText(),
      'SNAME_ENG'          => new sfWidgetFormInputText(),
      'IGEOGRAPHIC_REGION' => new sfWidgetFormInputText(),
      'ISTATION_ID'        => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IPROVINCE_ID'       => new sfValidatorChoice(array('choices' => array($this->getObject()->getIprovinceId()), 'empty_value' => $this->getObject()->getIprovinceId(), 'required' => false)),
      'SNAME_THAI'         => new sfValidatorString(array('max_length' => 100)),
      'SNAME_ENG'          => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'IGEOGRAPHIC_REGION' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ISTATION_ID'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('provinces[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Provinces';
  }


}
